package com.foolishbird.sdk.ui.assist;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.foolishbird.sdk.ui.fragment.FoolishBirdLoginAccountFragment;
import com.foolishbird.sdk.ui.fragment.FoolishBirdLoginFragment;
import com.foolishbird.sdk.ui.fragment.FoolishBirdLoginPhoneFragment;
import com.foolishbird.sdk.ui.fragment.PhoneLoginFragment;


public class LoginTypeSwitchAdapter extends FragmentPagerAdapter {

    private static final short DEFAULT_MAX_PAGER_COUNT = 2;

    private static final Fragment[] fragments = new Fragment[DEFAULT_MAX_PAGER_COUNT];

    public LoginTypeSwitchAdapter(FragmentManager fragment, FoolishBirdLoginFragment parent) {
        super(fragment);
//        fragments[0] = new PhoneLoginFragment();
        fragments[0] = new FoolishBirdLoginPhoneFragment(parent);
        fragments[1] = new FoolishBirdLoginAccountFragment(parent);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }

}
